package thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo18 {
    public static void main(String[] args) {
        ExecutorService ThreadPool = Executors.newFixedThreadPool(4);
        for (int i = 0; i < 1000; i++) {
            int id = i;
            ThreadPool.submit(()->{
                System.out.println(id+Thread.currentThread().getName());
            });
        }
    }
}
